<html>
<head>
<title>商品管理</title>
</head>
<script language="javascript">
	
	function editPdtcode(id){
	var spid = id.substring(2);
	var urlstr = "__URL__/editPdtCode?id_tb_product_cat_code="+spid;
	openWin(urlstr,"修改商品大类编码信息",'editwin',350,350);
	
	}
	
	function delPdtcode(id){
	var spid = id.substring(3);
	if(confirm("要删除分类为["+$(spid+'describe').innerHTML+" ]的编码[ "+$(spid+'cat_code').innerHTML+" ]么？"))
     {
		var urlstr = '__URL__/delPdtCode?id_tb_product_cat_code='+spid;

		openWin(urlstr,'删除大类编码','delcodewin',400,350);
	 }
	}
	
	function editPdt(id){
	var spid = id.substring(2);
	var urlstr = "__URL__/editPdt?id_tb_product="+spid;

	openWin(urlstr,'修改商品信息','edpdtwin',350,550);

	}
	
	function delPdt(id){
	var spid = id.substring(3);
	if(confirm("要删除编码为["+$(spid+'simple_code').innerHTML+" ]的商品[ "+$(spid+'product_name').innerHTML+" ]么？"))
     {
		var urlstr = '__URL__/delPdt?id_tb_product='+spid;

		openWin(urlstr,'删除商品信息','delpdtwin',400,350);
	 }
	}
	
	
	function showpForm(){
	 var urlstr = "__URL__/addPdtForm";	
	 openWin(urlstr,'添加商品信息','addpdtwin',500,600);
	}

	function showpForm2(){
	 var urlstr = "__URL__/ascPdtForm";	
	 openWin(urlstr,'同步淘宝商品信息','addpdtwin2',785,600);
	}	
	
	function showForm(){
	 var urlstr = "__URL__/addPdtCodeForm";	
	 openWin(urlstr,'添加商品大类编码信息','addcodewin',400,350);
	}

	function showFormAs(){
	 var urlstr = "__URL__/addPdtCodeFormAs";	
	 openWin(urlstr,'添加商品大类编码信息','addcodewin2',400,350);
	}	
	
	function switchPdtCode(){
	var tp = $('pdtCodeShow').style.display ;
	switch(tp.toString().length)
	   {
	   case 4: $('pdtCodeShow').style.display = 'block';
	   break
	   case 5:$('pdtCodeShow').style.display = 'none';
	   break
	   default:{}
	   }
  }	
</script>  
<body>
<!--主页面开始-->
<div id="maindptPage">

<!--显示商品列表开始-->
	<!--显示数据列表-->
	<div id="dbList" style="text-align:center">
		<!--空记录开始-->
		<if condition="count($dbList) elt 0">
		<h3>没有数据信息</h3><br />
		<input type="button" name="bt3" value="领取新任务"  class="button" onClick="window.location='__APP__/Index/panel?p=getTask';">
		</if>
		<!--空记录结束-->	
		<!--数据集显示开始-->
		<!--商品分类编码默认不显示，显示商品列表-->
		<div id="dbShow"  >
		<if condition="count($dbList) gt 0">
		<h3 style="text-align:center">商品列表</h3>
			<table align="center" bgcolor="#e7efff" width="100%" border="1" cellspacing="1" cellpadding="1" style="font-size:12px;">
		      		<tr>
					 <td colspan="13" align="center" valign="bottom"><input type="button" name="bt2" class="button" value="添加新商品信息" onClick="showpForm()">
				      <input type="button" name="bt99" class="button" value="同步淘宝商品信息" onClick="showpForm2()">
				      <input type="button" name="bt992" class="button" value="测试获得商品详情" onClick="showItem()">
	<input type="button" id="btau" style="display:none;" value="获得Session" class="button" onClick="if($('aukey').value!='')getSession();else{msg('输入授权key');}">	
				<input type="text" id="aukey" style="display:none;" value="请把授权key复制到这里" onClick="this.value='';" size="45" >					
				<input type="button" name="bt9922" class="button" value="测试修改商品详情" onClick="updateItem()">
				<input type="button" name="bt9922" class="button" value="上架商品" onClick="listingItem()">
				<input type="button" name="bt99222" class="button" value="下架商品" onClick="delistingItem()"></td>
		      		</tr>
                    <tr>
                        <td bgcolor="#FF9933">商品id</td>
                        <td bgcolor="#FF9933">商品图片</td>						
                        <td bgcolor="#FF9933">商品简码</td>						
                        <td bgcolor="#FF9933">商品名称</td>

                        <td bgcolor="#FF9933">商品单位</td>
                        <td bgcolor="#FF9933">商品重量(克)</td>						
                        <td bgcolor="#FF9933">供货商</td>						
<!--                        <td bgcolor="#FF9933">商品特征</td>	-->					
                        <td bgcolor="#FF9933">商品售价</td>						
                        <td bgcolor="#FF9933">商品进价</td>																																																						
						<td bgcolor="#FF9933">修改</td>
						<td bgcolor="#FF9933">删除</td>
                    </tr>
						<div id="list" >
                          <volist name="dbList" id="vo">
                            <tr id="{$vo.id_tb_product}" onMouseOver="this.style.backgroundColor='#f7f7f7'"
							onmouseout="this.style.backgroundColor='transparent'" >
							  <td id="{$vo.id_tb_product}">{$vo.id_tb_product}</td>
                              <td id="{$vo.id_tb_product}pic"><img src="__PUBLIC__/Uploads/{$Think.session.UserInfo.boss}/s_{$vo.pic}" /></td>	
                              <td id="{$vo.id_tb_product}simple_code">{$vo.simple_code}</td>							  
                              <td id="{$vo.id_tb_product}product_name">{$vo.product_name}</td>

                              <td id="{$vo.id_tb_product}unit">{$vo.unit}</td>
                              <td id="{$vo.id_tb_product}weight">{$vo.weight}</td>							  							  
                              <td id="{$vo.id_tb_product}supplier">{$vo.supplier}</td>							  
                              <td id="{$vo.id_tb_product}price">{$vo.price}</td>							  
                              <td id="{$vo.id_tb_product}in_price">{$vo.in_price}</td>							  
                              <td id="ed{$vo.id_tb_product}" onClick="editPdt(this.id)"><img src="__PUBLIC__/Images/edit.ico" alt="修改商品信息"/></td>
                              <td id="del{$vo.id_tb_product}" onClick="delPdt(this.id)"><img src="__PUBLIC__/Images/del.ico" alt="删除商品信息"/></td>	
                            </tr>
                          </volist>
                        </div>
					<tr>
                    <td align="center" colspan="12">		
					<?php
					if(isset($page)) echo $page;		
					?>	</td>
                    </tr>
		  	</table>
		<!--数据集显示结束-->
		</if>
		</div>
	</div>
		
<!--显示商品列表结束-->
	
</div>
<!--主页面结束-->
</body>
</html>